package com.hy.hyaudio

import android.Manifest
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import com.hy.hyaudio.databinding.ActivityMainBinding
import com.hy.hyaudio.opensles.OpenSLESHomeActivity
import com.hy.opensles.HYOpenSlRecorder
import java.io.File

class MainActivity : AppCompatActivity() {
    companion object {
        private const val TAG = "MainActivity"
    }

    private lateinit var binding: ActivityMainBinding

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = ActivityMainBinding.inflate(layoutInflater)
        setContentView(binding.root)
        initListener()
        getPermission()
    }

    private fun getPermission() {
        requestPermissions(arrayOf(Manifest.permission.RECORD_AUDIO),1000)

    }

    private fun initListener() {

        //openSL ES录音和播放功能
        binding.tvOpenSLES.setOnClickListener {
            val intent=Intent(this,OpenSLESHomeActivity::class.java)
            startActivity(intent)
        }



    }
}